library(tidyverse)
## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ dplyr 1.1.2 ✔ readr 2.1.4
## ✔ forcats 1.0.0 ✔ stringr 1.5.0
## ✔ ggplot2 3.4.2 ✔ tibble 3.2.1
## ✔ lubridate 1.9.2 ✔ tidyr 1.3.0
## ✔ purrr 1.0.1
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag() masks stats::lag()
## ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
library(googlesheets4)
gs4_deauth()
event_reg <- read_sheet("https://docs.google.com/spreadsheets/d/1Iqxq3Eb5xh_BIiLf3GOokuC9JWdOBVUycUQa-rWiWiA/edit?usp=sharing")
## ✔ Reading from "Event Registration (Responses)".
## ✔ Range 'Form Responses 1'.
event_reg %>%
write_rds("data/event_reg.rds")
barplot(table(event_reg$`Dietary restrictions`))

library(tidyverse)
ggplot(
data = event_reg,
aes(x = `Dietary restrictions`)) +
geom_bar() +
coord_flip()

library()
DT::datatable(event_reg)
library(ggplot2)
library(plotly)
##
## Attaching package: 'plotly'
## The following object is masked from 'package:ggplot2':
##
## last_plot
## The following object is masked from 'package:stats':
##
## filter
## The following object is masked from 'package:graphics':
##
## layout
# Create the ggplot object
p <- ggplot(data = event_reg, aes(x = `Dietary restrictions`, fill = `Dietary restrictions`)) +
geom_bar() +
coord_flip() +
theme_minimal() +
labs(
x = "Dietary Restrictions",
y = "Count",
title = "Distribution of Dietary Restrictions"
) +
theme(
plot.title = element_text(size = 16, face = "bold", hjust = 0.5), # Center the title
axis.title.x = element_text(size = 12),
axis.title.y = element_text(size = 12),
axis.text = element_text(size = 10),
legend.title = element_blank(),
legend.text = element_text(size = 10),
legend.position = "none"
)
# Convert ggplot object to interactive plot
ggplotly(p)